import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: () => import("@/views/article/Index"),
  },
  {
    path: "/category/:id",
    name: "category",
    component: () => import("@/views/article/Index"),
  },
  {
    path: "/tag/:id",
    name: "tag",
    component: () => import("@/views/article/Index"),
  },
  {
    path: "/archives",
    name: "archives",
    component: () => import("@/views/archives/Archives"),
  },
  {
    path: "/archives/detail/:id",
    name: "archives",
    component: () => import("@/views/archives/Detail"),
  },
  {
    path: "/archives",
    name: "archives",
    component: () => import("@/views/archives/Archives"),
  },
  {
    path: "/konwledge",
    name: "Konwledge",
    component: () => import("@/views/konwledge/Konwledge"),
  },
  // 知识小册第一个详情页
  {
    path: '/konwledge/:id',
    name: 'Konwledgepid',
    component: () => import("@/views/konwledge/Detail"),
  }
  ,
  // 知识小册第二个详情页
  {
    path: '/konwledge/:id/:kid',
    name: 'konwledgeKid',
    component: () => import("@/views/konwledge/KidDetail"),
  }
  ,
  {
    path: "/page",
    name: "Page",
    component: () => import("@/views/page/Index"),
    children: [
      {
        path: "/page/about",
        name: "About",
        component: () => import("@/views/page/index/About"),
      },
      {
        path: "/page/mesboard",
        name: "mesboard",
        component: () => import("@/views/page/index/Mesboard"),
      },
    ]
  }, {
    path: '/article/detail/:id',
    name: 'Detail',
    component: () => import('@/views/article/Detail')
  }
]

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
